package org.pzy.repository;

import org.pzy.entity.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: DRevelation
 * @Date: 2022/8/30 14:13
 */
@Repository
public interface UserRepository extends CrudRepository<User, Long> {

    @Query("FROM User")
    List<User> findByQuery();

    @Query(value = "select * from user", nativeQuery = true)
    List<User> findBySQLQuery();
}
